package com.blog.util;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate4.support.HibernateDaoSupport;
/**
 * dao层的通用自定义父类<br> 
 * 继承HibernateDaoSupport类，并负责将SessionFactory注入到父类中<br>
 * @author Administrator
 *@version 0.1
 */
public class MyHibernateDaoSupport extends HibernateDaoSupport {
	
	@Resource
	private SessionFactory sessionFactory;
	
	/**
	 *由于父类的setSessionFactroy是final状态，子类无法复写
	 *通过postConstruct这个注解将sessionFactory注入到父类<br>
	 *  
	 */
	@PostConstruct
	public void injectSessionFactory(){
		super.setSessionFactory(sessionFactory);
	}
	
	
	 
	
 
	
}
